package com.dx.chat.client;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import lombok.Data;

import java.net.Socket;

/**
 * Description: 客户端界面的javabean
 *
 * @author rockstarsteve
 * @version 1.0
 * @copyright Copyright (c) 电信
 * @since 2023/9/8
 */
@Data
public class ClientInfoBean {

    /**
     * 连接的socket
     */
    private Socket socket = null;
    /**
     * 是否连接标识
     */
    private boolean connected = false;
    /**
     * 服务器ip
     */
    private StringProperty ip = new SimpleStringProperty("127.0.0.1");
    /**
     * 服务器断开
     */
    private StringProperty port = new SimpleStringProperty("8088");

    /**
     * 聊天消息内容
     */
    private StringProperty chatInfoString = new SimpleStringProperty("");
    /**
     * 文件路径
     */
    private StringProperty filePath = new SimpleStringProperty();
    /**
     * 发送消息内容
     */
    private StringProperty sendMsg = new SimpleStringProperty();

    public Socket getSocket() {
        return socket;
    }

    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    public boolean isConnected() {
        return connected;
    }

    public void setConnected(boolean connected) {
        this.connected = connected;
    }

    public String getIp() {
        return ip.get();
    }

    public StringProperty ipProperty() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip.set(ip);
    }

    public String getPort() {
        return port.get();
    }

    public StringProperty portProperty() {
        return port;
    }

    public void setPort(String port) {
        this.port.set(port);
    }

    public String getChatInfoString() {
        return chatInfoString.get();
    }

    public StringProperty chatInfoStringProperty() {
        return chatInfoString;
    }

    public void setChatInfoString(String chatInfoString) {
        this.chatInfoString.set(chatInfoString);
    }

    public String getFilePath() {
        return filePath.get();
    }

    public StringProperty filePathProperty() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath.set(filePath);
    }

    public String getSendMsg() {
        return sendMsg.get();
    }

    public StringProperty sendMsgProperty() {
        return sendMsg;
    }

    public void setSendMsg(String sendMsg) {
        this.sendMsg.set(sendMsg);
    }
}
